﻿using System;
using Dsl.Ped.Framework.Common;

namespace Dsl.Ped.Framework.Exceptions 
{
    /// <summary>
    /// Exception being thrown when attempt to get the projection which is not registered under the
    /// provided name
    /// </summary>
    public class ProjectionNotRegisteredException : Exception 
    {
        /// <summary>
        /// Gets or sets the container in which the projection is not registered
        /// </summary>
        private IProjectionContainer ProjectionContainer { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectionNotRegisteredException"/> class.
        /// </summary>
        /// <param name="projectionContainer">The projection container in which the projection is not registered</param>
        /// <param name="projectionName">The name of the projeciton which is not registered</param>
        public ProjectionNotRegisteredException(IProjectionContainer projectionContainer, string projectionName)
            : base(string.Format("Projection {0} is not registered for the container {1}", projectionName, projectionContainer.Name))
        {
            this.ProjectionContainer = projectionContainer;
        }
    }
}
